package com.shop.shop.model;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ChartMysql {
    private Long cid;
    private Long uid;
    private String goodList;//json
    private BigDecimal sumPrice;

    public ChartMysql(Long cid, Long uid, String goodList, BigDecimal sumPrice) {
        this.cid = cid;
        this.uid = uid;
        this.goodList = goodList;
        this.sumPrice = sumPrice;
    }
    public ChartMysql() {
        this.cid=null;
        this.goodList=null;
        this.sumPrice=null;
    }
    public ChartMysql(Chart chart){
        this.cid=chart.getCid();
        this.uid=chart.getUid();
        this.sumPrice=chart.getSumPrice();
        this.goodList= JSONObject.toJSONString(chart.getGoodList());
    }
}
